home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 501-525 / disk_503 / pcq / pcq12a.lzh / Examples / Extern1.p < prev    next >
Text File  |  1990-07-17  |  1KB  |  46 lines

  1. Program External_Part_One;
  2.  
  3. {
  4.     This program demonstrates how to use the External
  5. procedure and function mechanism of PCQ.  This file contains
  6. the main program (you can tell this because it begins with
  7. the reserved word Program, whereas files of external program
  8. will begin with the reserved word External).  Be sure to take
  9. a look at Extern2.p to see how the other half works.
  10.  
  11. In order to put together this file, follow these steps:
  12.  
  13. 1.  Compile the external file with a line like the following:
  14.  
  15.     Pascal Extern2.p Extern2.asm
  16.     A68k Extern2.asm Extern2.o
  17.  
  18. 2.  Compile the main program file:
  19.  
  20.     Pascal Extern1.p Extern1.asm
  21.     A68k Extern1.asm Extern1.o
  22.  
  23. 3.  Link both files:
  24.  
  25.     Blink Extern1.o Extern2.o to Extern library PCQ.lib
  26.  
  27.     This will create a file called Extern that contains the main
  28. program, defined here, and the external procedure defined in Extern2.
  29. Note that the main file must be listed first, but after that the order
  30. doesn't matter.  For another example of a multiple-source-file program,
  31. take a look at the source of the compiler itself.
  32. }
  33.  
  34.     Procedure WriteMessage;
  35.     External;
  36.  
  37. {   The preceding lines declare the procedure, and let the compiler know
  38.     that the procedure is supposed to be defined in a different source
  39.     file.  The compiler has no way of verifying that the external
  40.     procedure actually exists, by the way.  The linker handles that part.
  41. }
  42.  
  43. begin
  44.     WriteMessage;
  45. end.
  46.